package com.klw.business.service.impl;

import java.util.List;
import com.klw.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.klw.business.mapper.KlwClassMapper;
import com.klw.business.domain.KlwClass;
import com.klw.business.service.IKlwClassService;

/**
 * 班级Service业务层处理
 * 
 * @author klw
 * @date 2025-08-24
 */
@Service
public class KlwClassServiceImpl implements IKlwClassService 
{
    @Autowired
    private KlwClassMapper klwClassMapper;

    /**
     * 查询班级
     * 
     * @param classId 班级主键
     * @return 班级
     */
    @Override
    public KlwClass selectKlwClassByClassId(Long classId)
    {
        return klwClassMapper.selectKlwClassByClassId(classId);
    }

    /**
     * 查询班级列表
     * 
     * @param klwClass 班级
     * @return 班级
     */
    @Override
    public List<KlwClass> selectKlwClassList(KlwClass klwClass)
    {
        return klwClassMapper.selectKlwClassList(klwClass);
    }

    /**
     * 新增班级
     * 
     * @param klwClass 班级
     * @return 结果
     */
    @Override
    public int insertKlwClass(KlwClass klwClass)
    {
        klwClass.setCreateTime(DateUtils.getNowDate());
        return klwClassMapper.insertKlwClass(klwClass);
    }

    /**
     * 修改班级
     * 
     * @param klwClass 班级
     * @return 结果
     */
    @Override
    public int updateKlwClass(KlwClass klwClass)
    {
        klwClass.setUpdateTime(DateUtils.getNowDate());
        return klwClassMapper.updateKlwClass(klwClass);
    }

    /**
     * 批量删除班级
     * 
     * @param classIds 需要删除的班级主键
     * @return 结果
     */
    @Override
    public int deleteKlwClassByClassIds(Long[] classIds)
    {
        return klwClassMapper.deleteKlwClassByClassIds(classIds);
    }

    /**
     * 删除班级信息
     * 
     * @param classId 班级主键
     * @return 结果
     */
    @Override
    public int deleteKlwClassByClassId(Long classId)
    {
        return klwClassMapper.deleteKlwClassByClassId(classId);
    }
}
